package com.study.reference;


import com.study.entity.Person;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author HBZ
 * @Date 2020/9/11 14:51
 * @Description
 */
public class Test {
    private static ThreadLocal<Person> tl = new ThreadLocal<>();

    public static void main(String[] args) {
        Person person = new Person("zhangsan", 5);


    /* Runnable runnable=()->{
         tl.set(person);
         tl.get();
     };*/
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                tl.set(person);
                System.out.println(tl.get());
            }
        };
        Thread t1 = new Thread(runnable);
        t1.start();
        System.out.println(1111);
        ReentrantLock lock = new ReentrantLock();
    }
}
